echo "=====start====="
if [ -n "$1" ] ;then
	echo 'date:' $1
	datepath=/spark/dx/$1
	basepath=/spark/dataset/originalData
	clearpath=/spark/dx/$1/01.DxFileClear
	configpath=/spark/dataset/configData

	hadoop fs -rm -f -r /spark/dx/
	mkdir $datepath -p
	mkdir $basepath -p
	mkdir $clearpath -p

	out02=/spark/dx/$1/02.DxFileMatch
	out03=/spark/dx/$1/03.DxFilePathStatistic
	out04=/spark/dx/$1/04.DxPath
	out05=/spark/dx/$1/05.DxTopN
	out06=/spark/dx/$1/06.DxProMatch
	out07=/spark/dx/$1/07.DxProStatistic
	out08=/spark/dx/$1/08.DxProStatisticAll
	out09=/spark/dx/$1/09.DxPersona
	out10=/spark/dx/$1/10.DxSaleUser
	out11=/spark/dx/$1/11.DxLiveTime

	alsoujt=hdfs:///dx/$1/alsout
	prolikeout=hdfs:///dx/$1/prolikeout
	relationout=hdfs:///dx/$1/relationout
	userrelationout=hdfs:///dx/$1/userrelationout
	livedataout=hdfs:///dx/$1/livedataout

	hadoop fs -test -d $basepath
	
	echo "hadoop fs" $?
	#00 01.DxFileClear
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.dataclean1.DxFileClear /spark/dataset/originalData/000002_0 $clearpath
	#01 02.DxFileMatch
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.datamatch2.DxFileMatchDriver $configpath/t_dx_basic_msg_addr.txt $clearpath $out02
	#02 03.DxCountPv
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.DPSP3.DxPathStatisticDriver $out02 $out03
	#03 04.DxCountUv
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.UV4.UYGUVMJMain $out03 $out04
	#03 05.DxCountTopn
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.TopN5.DxTopN $out03 $out05
	#02 06.DxProMatch
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.DDPM6.DriverDxProMatch $configpath/t_dx_product_msg_addr.txt $out02 $out06
	#06 07.DxProCountPV
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.DPD7.DxProStatisticDriver $out06 $out07
	#07 08.DxProCountUV
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.SA8.DxProStatisticAllDriver $out07 $out08
	#03 09.DxPerson
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.DDP9.DriverDxPersona $configpath/t_dx_basic_classify_link.txt $out03 $out09
	#02 10.DxPerCountPV
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.DDSU10.DriverDxSaleUser $out02 $out10
	#10 11.DxLiveTime
	hadoop jar sparkjob-1.0.jar com.jida.hadoop.mr.LCGM11.LifeCycleJudgeMain 3 /spark/dx $1 $out10 $out11
else
	echo 'no parameter!'
fi
